using System.Reflection.Emit;
using System.Threading.Tasks;
namespace DesignPattern.Creational.Singleton
{
    public class SingletonPattern
    {
        public static void Test()
        {
            Parallel.Invoke(
                () => SingletonByDoubleIF.GetInstance().ShowCreater(),
                () => SingletonByDoubleIF.GetInstance().ShowCreater(),
                () => SingletonByDoubleIF.GetInstance().ShowCreater()
            );

            Parallel.Invoke(
                () => SingletonByStatic.GetInstance().ShowCreater(),
                () => SingletonByStatic.GetInstance().ShowCreater(),
                () => SingletonByStatic.GetInstance().ShowCreater()
            );
        }
    }
}